﻿<!--#include file="../base.asp"-->
<!--#include file="FCKeditor/fckeditor.asp" -->
<%if checkIP("add_info") then %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑信息资源</title>
<link href="../skin/default/main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<%
dim contid,local,strSQL,rs,rsCont,catID
contid=request.QueryString("contid")
local=request.QueryString("local")

if local="info" then
'strSQL="select * from category where parCat in (select catID from category where parCat=10 and [delete]=0) and [delete]=0"
strSQL="select * from category where parCat in (select catID from category where parCat=10 and [delete]=0) and catID<>26 and catID<>25 and [delete]=0 union select * from category where parCat=26 and [delete]=0 union select * from category where parCat=25 and [delete]=0"
end if

if local="test" then
strSQL="select * from category where parCat in (select catID from category where parCat in (select catID from category where parCat=28 and [delete]=0) and [delete]=0) and [delete]=0 union select * from category where catID=30"
end if

set rs=GetRecordset(strSQL,0)

if contid<>"" then
strSQL="select * from [info] where infoID="&contid&" and [delete]=0"
set rsCont=GetRecordset(strSQL,0)
catID=rsCont("catID")
end if

if contid<>"" then
%>
<form action="save.asp?local=<%=local%>&contid=<%=contid%>" method="post">
<%
else
%>
<form action="save.asp?local=<%=local%>" method="post">
<%
end if
%>
<table border="0" width="100%">
<tr><td colspan="6">
<%
if contid="" then
%>
添加信息资源
<%
else
%>
修改信息资源
<%
end if
%>
</td></tr>
  <tr>
    <td>标题：</td>
    <%
    if contid<>"" then
    %>
    <td><input type="text" id="title" name="title" value="<%=rsCont("infoTitle")%>" /></td>
    <%
    else
    %>
    <td><input type="text" id="title" name="title" value=""/></td>
    <%
    end if
    %>
    <td width="50px">类别：<td><select name="cat" id="cat">
      <option value="">请选择类别</option>
	  <%
	  if not rs.eof and not rs.bof then
	  do while not rs.eof
	    if rs("catID")=catID then
	  %>
	  <option value="<%=rs("catID")%>" selected="selected"><%=rs("catName")%></option>
	  <%
	  else
	  %>
	  <option value="<%=rs("catID")%>"><%=rs("catName")%></option>
	  <%
	  end if
	  rs.movenext
	  loop
	  end if
	  %>
    </select></td>
    <td>登录后查看：</td><td>
    <%
    if contid<>"" then
    if rsCont("needLogin")="True" then
    %>
    <input id="ckbLogin" name="ckbLogin" type="checkbox" checked="checked" />需登录
    <%
    else
    %>
    <input id="ckbLogin" name="ckbLogin" type="checkbox" />需登录
    <%
    end if
    else
    %>
    <input id="ckbLogin" name="ckbLogin" type="checkbox" />需登录
    <%
    end if
    %>
    </td></td>
  </tr>
  <tr>
    <td class="td_vlign" style="vertical-align:top;">内容：</td>
    <td colspan="5">
    <%
         Dim sBasePath
         sBasePath = "fckeditor/"
         Dim oFCKeditor
         Set oFCKeditor = New FCKeditor
         oFCKeditor.BasePath	= sBasePath
         oFCKeditor.Config("AutoDetectLanguage") = False
         oFCKeditor.Config("DefaultLanguage")    = "zh-cn"
         if contid<>"" then
            oFCKeditor.Value	= rsCont("infoContent")
            rsCont.close
            set rsCont=nothing
         else
            oFCKeditor.Value	= ""
         end if
         oFCKeditor.Create "content"
  	%>
  	</td>
  </tr>
  <tr>
    <td>上传：</td>
    <td colspan="5"><iframe src="upload.asp" width="100%" height="24" frameborder="0" scrolling="no"></iframe></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="5">&nbsp;<input type="submit" value="提交" />&nbsp;&nbsp;<input type="reset" value="重置" /></td>
  </tr>
</table>
</form>
<%
rs.close
set rs=nothing
%>
</body>
</html>
<%end if %>